package com.mall4j.cloud.user.service.impl;

import com.mall4j.cloud.user.model.UserBalance;
import com.mall4j.cloud.user.mapper.UserBalanceMapper;
import com.mall4j.cloud.user.service.UserBalanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserBalanceServiceImpl implements UserBalanceService {

    @Autowired
    private  UserBalanceMapper userBalanceMapper;



    @Override
    public UserBalance getByUserId(Long userId) {
        return userBalanceMapper.getByUserId(userId);
    }

    @Override
    public void update(UserBalance userBalance) {
        userBalanceMapper.update(userBalance);
    }

    @Override
    public void save(UserBalance userBalance) {
        userBalanceMapper.save(userBalance);
    }

    @Override
    public UserBalance createUserBalance(UserBalance userBalance) {
        userBalanceMapper.save(userBalance);
        return userBalance;
    }

    // 其他用户余额相关的业务方法的实现
}
